package com.example.shopping2.a_c_fragment.home

import android.content.Context
import android.util.AttributeSet
import android.util.LogPrinter
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
import com.blankj.utilcode.util.ToastUtils
import com.example.shopping2.R

class SearchBox : LinearLayout {

    constructor(context: Context, attributeSet: AttributeSet) : super(
        context, attributeSet
    ) {
        init(context,attributeSet)
    }
    fun init(context: Context,attributeSet: AttributeSet){
        var inflate = LayoutInflater.from(context).inflate(R.layout.searchbox, this, false)
        var searchimg = inflate.findViewById<ImageView>(R.id.search_img)
        var searchtext = inflate.findViewById<TextView>(R.id.search_tex)
        var searchzx = inflate.findViewById<ImageView>(R.id.search_zx)
        searchzx.setOnClickListener {
            ToastUtils.showShort("二维码")
        }
        addView(inflate)

    }


}